﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;

namespace com.intellitack.layar.library
{
    public class LayarUtilities
    {
        public static string TestSerialization(ILayerObject target) 
        {
            //Create a new JavaScript Serializer to Serialize the Class to a JSON String
            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
            //Create a list of my custom converters
            List<JavaScriptConverter> customConverters = new List<JavaScriptConverter>();
            customConverters.Add(new LayerCustomConverter());
            jsSerializer.RegisterConverters(customConverters);
            return jsSerializer.Serialize(target);
        }
    }
}
